<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>
	<button id="btn">点击存储 cookie </button>	
</body>
<script>
	var btn = document.getElementById( 'btn' );
	btn.onclick = function () {
		// 存储 cookie 
		document.cookie = 'key=value';
	};	
</script>
</html>